package com.example.kaoqinmanager.activity;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.text.TextUtils;
import android.view.MenuItem;
import android.view.View;
import android.widget.TextView;

import com.example.kaoqinmanager.base.BaseBindingActivity;
import com.example.kaoqinmanager.databinding.ActivityAskForLeaveBinding;
import com.example.kaoqinmanager.utils.MyToast;

public class AskForLeaveActivity extends BaseBindingActivity<ActivityAskForLeaveBinding> {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        actionBar.setTitle("请假");
        //显示返回箭头默认是不显示的
        actionBar.setDisplayHomeAsUpEnabled(true);


        getBinding().btnOk.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                String trim = getBinding().edContent.getText().toString().trim();
                if (TextUtils.isEmpty(trim)) {
                    MyToast.showToast("内容不能为空");
                    return;
                }
                MyToast.showToast("请假成功");
                finish();
            }
        });


    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
            //actionbar的左侧图标的点击事件处理
            case android.R.id.home:
                finish();
                break;
        }
        return super.onOptionsItemSelected(item);
    }
}